<html>
<head><meta charset="utf-8"><title>mir_opt_level changes · t-compiler/shrinkmem-sprint · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/index.html">t-compiler/shrinkmem-sprint</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level.20changes.html">mir_opt_level changes</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="228780431"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level%20changes/near/228780431" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level.20changes.html#228780431">(Mar 04 2021 at 14:24)</a>:</h4>
<p>one thing that needs discussion now is which optimizations from level 3 do we want to make it level 2 (on by default on "release" mode)</p>



<a name="228780462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level%20changes/near/228780462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level.20changes.html#228780462">(Mar 04 2021 at 14:25)</a>:</h4>
<p>I meant, we would be placing a PR and running perf on them</p>



<a name="228780518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level%20changes/near/228780518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level.20changes.html#228780518">(Mar 04 2021 at 14:25)</a>:</h4>
<p><span class="user-mention" data-user-id="124288">@oli</span> told me to ask <span class="user-mention" data-user-id="352985">@tm</span> about good first candidates</p>



<a name="228780568"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level%20changes/near/228780568" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level.20changes.html#228780568">(Mar 04 2021 at 14:25)</a>:</h4>
<p><span class="user-mention silent" data-user-id="124288">oli</span> also told me that <code>?</code> opt may be a good candidate</p>



<a name="228794759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level%20changes/near/228794759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level.20changes.html#228794759">(Mar 04 2021 at 15:42)</a>:</h4>
<p>As far as I know <code>-Zmir-opt-level=1</code> is used for all optimization levels. At least MIR inlining is not enabled when optimizations are enabled, yet it only requires <code>-Zmir-opt-level=2</code>.</p>



<a name="228795180"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level%20changes/near/228795180" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tm <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level.20changes.html#228795180">(Mar 04 2021 at 15:44)</a>:</h4>
<p>In context of changes from <a href="https://github.com/rust-lang/rust/issues/82736">#82736</a>.</p>



<a name="228795360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level%20changes/near/228795360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level.20changes.html#228795360">(Mar 04 2021 at 15:45)</a>:</h4>
<p>right <span class="user-mention" data-user-id="352985">@tm</span>, sorry for not being clear that what I was saying is once that PR lands :)</p>



<a name="228795465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level%20changes/near/228795465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level.20changes.html#228795465">(Mar 04 2021 at 15:46)</a>:</h4>
<p>so the idea now is that the optimizations we have on level 3 on that PR, we would like to provide followup PRs that move each one to level 2 and run perf on them</p>



<a name="228795508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level%20changes/near/228795508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level.20changes.html#228795508">(Mar 04 2021 at 15:46)</a>:</h4>
<p>my question for <span class="user-mention" data-user-id="352985">@tm</span> was, which optimizations are the ones you consider more important to try first?</p>



<a name="228801326"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level%20changes/near/228801326" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> tm <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level.20changes.html#228801326">(Mar 04 2021 at 16:15)</a>:</h4>
<p>After looking a bit, I don't think I will have any concrete suggestions.</p>



<a name="229316527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level%20changes/near/229316527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level.20changes.html#229316527">(Mar 08 2021 at 15:27)</a>:</h4>
<p>the "setup" changes have landed</p>



<a name="229316649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level%20changes/near/229316649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level.20changes.html#229316649">(Mar 08 2021 at 15:28)</a>:</h4>
<p>opened <a href="https://github.com/rust-lang/rust/issues/82903">#82903</a>, <a href="https://github.com/rust-lang/rust/issues/82904">#82904</a>, <a href="https://github.com/rust-lang/rust/issues/82905">#82905</a>, <a href="https://github.com/rust-lang/rust/issues/82906">#82906</a> to check on each opt if there are improvements so we can move to level 2</p>



<a name="229316700"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level%20changes/near/229316700" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Santiago Pastorino <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level.20changes.html#229316700">(Mar 08 2021 at 15:29)</a>:</h4>
<p>the only in that is currently in level 3 that I didn't touch is the inliner because <span class="user-mention" data-user-id="124288">@oli</span> told me that <span class="user-mention" data-user-id="125250">@Wesley Wiser</span> was on it</p>



<a name="229317020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level%20changes/near/229317020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Wesley Wiser <a href="https://rust-lang.github.io/zulip_archive/stream/276895-t-compiler/shrinkmem-sprint/topic/mir_opt_level.20changes.html#229317020">(Mar 08 2021 at 15:30)</a>:</h4>
<p>Yeah, <a href="https://github.com/rust-lang/rust/issues/82280">#82280</a> seems to be basically the same idea in practice.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>